/**
 * 教师端  
 * 查看请假详情
 */
$(function(){
	var id = sessionStorage.getItem("id");
	$.ajax({
        url: "/huaqiao/front/teacher/getOneApply?id=" + id,
        async: false,
        success: function (str) {
            if (check(str)) {
            	
                $("#hstudentname").val(str.studentname);
                $("#hstartTime").val(DateUtils.format(new Date(str.startTime), "yyyy-MM-dd HH:mm:ss"));
                $("#hendTime").val(DateUtils.format(new Date(str.endTime), "yyyy-MM-dd HH:mm:ss"));
                $("#apply-reason").val(str.requestReason);
                
            }
        }
    });
  
 });
function goBack() {
	window.history.go(-1);
}
function check(str) {
    if (str != null && str != "" || str == 0) {
        if (str.errorcode != undefined) {
            if (str.errorcode == 1) {
                if (islogin == 1) {
                    layer.msg(str.errormessage, {time: 1000});
                    window.location.href = "/huaqiao/front_end/pc/teacher/login_pc_teacher.html";
                    islogin = 0;
                }
            }
            return false;
        } else {
            return true;
        }
    } else {
        return false;
    }
}